/***************************************************
> Copyright (C) 2024 ==RXX== All rights reserved.
> File Name: main.c
> Author: rxx
> Mail:2909017383@qq.com 
> Created Time: 2024年12月03日 星期二 17时16分53秒
***************************************************/

#include "userxx.h"
#include "adminxx.h"
#include "freexx.h"

void menu();
void main_inter();

int main(int argc,const char* argv[])
{
	main_inter();
	return 0;
}
//主菜单
void menu()
{
	printf("********************************************************\n");
	printf("\t\t\t1 用户界面\n");
	printf("\t\t\t2 管理界面\n");
	printf("\t\t\t3 会员管理界面\n");
	printf("\t\t\t4 退出\n");
	printf("********************************************************\n");
}
//主函数
void main_inter()
{
	int	 flag = 1;
	STU *head = NULL; 
	//申请头节点
	head = inputhead(head);
	head = readhead(head);

	ADM *admhead = NULL;
	admhead = inputAdmin(admhead);	

	MEM *memhead = NULL; 
	memhead=inputHeadMem(memhead);

	int num1 = 0,num = 0; 	
	while(flag)
	{
		menu();
		printf("输入要执行的命令：");
		scanf("%d",&num);
		switch(num)
		{
			case 1:
				menu1(head);
				break;
			case 2:
				printf("输入管理员账号和密码：\n");
				adminLogOn(admhead,head);
				break;
			case 3:
				regMem(memhead);
				break;
			case 4:
				flag = 0;
				break;
			default:
				printf("input error!");
				flag = 0;
				break;
		}
//		freeSpace(head);
	}
}
